package cn.com.cabinet.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cabinet.web.entity.Cabinet;

import cn.com.cabinet.dao.CabinetDao;

@Service
public class CabinetServiceImpl {
	@Autowired
	private CabinetDao cabinetDao;
	
	public List<Cabinet> getCabinetList(Integer page,Integer limit){
		List<Cabinet> cabinetList = cabinetDao.getCabinet(page, limit);
		return cabinetList;
	}
	
	public int getCabinetListTotal(){
		return (int) cabinetDao.count();
		
	}
	
	
	public void addCabinet(Cabinet ca){
		cabinetDao.save(ca);
	}
	
	public Cabinet getCabinetByCid(String cId){
		return cabinetDao.getCabinetByCid(cId);
		
	}
}
